using System.Globalization;
using System.Text.RegularExpressions;

namespace MaterialUI
{
	public static class IconDecoder
	{
		private static Regex m_RegExpression = new Regex("\\\\u(?<Value>[a-zA-Z0-9]{4})");

		public static string Decode(string value)
		{
			if (string.IsNullOrEmpty(value))
			{
				return string.Empty;
			}
			return m_RegExpression.Replace(value, (Match m) => ((char)(ushort)int.Parse(m.Groups["Value"].Value, NumberStyles.HexNumber)).ToString());
		}
	}
}
